home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / pascal / bp7_os2.zip / BP7-OS2.DOC next >
Text File  |  1993-11-10  |  8KB  |  224 lines

  1.                 DOCUMENTATION FOR BP7.x OS/2 PATCH
  2.                 ----------------------------------
  3.  
  4. Borland has for a while offered a C++ compiler for OS/2, but Pascal people
  5. still have to go on waiting.  With some minor alterationt to the compiler,
  6. units and the runtime library, you can now create 16-bit OS/2 programs for
  7. the OS/2 text modes and Presentation Manager. The German computer magazine
  8. c't has provided these patches for BP7.x
  9.  
  10. After applying the patches, you can now compile your DOS programs for
  11. OS/2. In most cases compiling for a DOS or OS/2 platform is just a matter
  12. of a command line switch, or changing the "Target" in the patched IDE.
  13.  
  14. The batch file "INSTALL.BAT" applies the patches to *copies* of your
  15. BP7.0 compiler and IDE (i.e., the original files are untouched).
  16.  
  17. Fuller details as to how to apply the patches can be found below.
  18.  
  19. I am currently trying to gather information about the OS/2 API calls, for
  20. the purpose of producing UNIT files to interface to the OS/2 API. Some of
  21. the API calls can already be found in the sources for the new DOS, CRT,
  22. and SYSTEM units. When I am able to gather sufficient information, I will
  23. upload the results to ftp-os2.cdrom.com and garbo.uwasa.fi. Note that this
  24. may take months.
  25.  
  26.  
  27. The files in this package are:
  28. ------------------------------
  29.  
  30. BP7-OS2.DOC    This file
  31. INSTALL.BAT    Copies the original files and makes the patches
  32. PATCHBP.PAS    Patches the compilers
  33. COMPATIB.PAS   Unit which provides DOS interrupt compatibility
  34. CRT.PAS        OS/2 port of the CRT unit
  35. DOS.PAS        OS/2 port of the DOS unit
  36. MAKEPM.PAS     Sets the flags for PM programs
  37. HELLO2.PAS     Writes "Hello, world"
  38. HELLOPM.PAS    "Hello, world!" in a PM application
  39. HELLOPM.RC     Resource file for HELLOPM.PAS
  40. THREAD.PAS     Demonstration for Threads
  41. VIDEO.PAS      Direct video access unit
  42. OS2RTL.EXE     Creates the OS/2 runtime library in OS2RTL\
  43.  
  44.  
  45. INSTALLATION PROCEDURE
  46. ----------------------
  47.  
  48. When I installed the patches, I did not have a lot of guidance, and
  49. I was using the German language version. I sorted things out by trial
  50. and error. I later received the original English language version
  51. from someone whose name I have forgotten, and all I have done is to
  52. amend one or two things in it, and to provide this documentation).
  53.  
  54. I have reduced all that I did into a number of steps. They may
  55. seem many, but they are actually quite straightforward.
  56.  
  57. In order to apply the patch, take the following steps;
  58.  
  59. 1. Make sure that the following executables are in your PATH statement
  60.    so that they can be called by the patch routines;
  61.         a. BPC.EXE
  62.         b. TASM.EXE
  63.         c. MAKE.EXE
  64.  
  65. 2. Create a directory for your patched files, from where you will
  66.    be running the OS/2 patches. It is important to make this decision
  67.    before you start anything, as it will make things go a lot
  68.    easier. I will refer to this directory from now on as "your
  69.    BP-OS2 directory".
  70.  
  71. 3. Change to your BP-OS2 directory, and UNZIP the file BP7-OS2.ZIP
  72.    into this directory.
  73.  
  74. 4. The batch file INSTALL.BAT assumes that your BP7.x binaries are
  75.    in a directory called \BP\BIN on the current drive. If they are
  76.    not, you need to edit this file to change all the references to
  77.    \BP\BIN to the correct directory paths.
  78.  
  79. 5. If you are using BP7.0,  type "INSTALL"
  80.    If you are using BP7.01, type "INSTALL 701"
  81.  
  82.    This will run the batch file that will copy the files;
  83.        BP.EXE
  84.        BPC.EXE
  85.    into the current directory.
  86.  
  87.    They will be called
  88.       BPOS2.EXE
  89.       BPCOS2.EXE respectively
  90.  
  91.   Then it will compile PATCHBP.EXE, and apply it to the EXE files that
  92.   have been copied.
  93.  
  94.   What the patch does is;
  95.          a. To add a new command line parameter "-CO" to your new
  96.             BPCOS2.EXE, to compile for an OS/2 platform. You can
  97.             still use the patched executable to compile for a DOS
  98.             platform by using the "-CD" parameter, and for DPMI, by
  99.             using the "-CP" parameter.
  100.  
  101.         b.  The unit files produced when you compile a unit for OS/2
  102.             will have the extension "TPO".
  103.  
  104.        c. In the new BPOS2 IDE, there will be a new target platform
  105.           (OS/2). This replaces "Windows" in the IDE.
  106.  
  107.        d. The default TPL file for OS/2 compilation is now
  108.           OS2.TPL
  109.  
  110.   That's about it really.
  111.  
  112. 6. Type "OS2RTL" - to extract the OS/2 run-time library files. This
  113.    creates a sub-directory called "OS2RTL" in the directory in which
  114.    you are operating, and further sub-directories called "INC", "LIB"
  115.    and "SYS" in that "OS2RTL" directory. The run-time files are
  116.    extracted into these directories.
  117.  
  118. 7. Change into the OS2RTL subdirectory.
  119.  
  120. 8. Edit the file "MAKEFILE". You should change the line
  121.       "BP = \OS2"
  122.  
  123.    to your BP-OS2 directory  (e.g., BP = C:\BP\OS2)
  124.  
  125. 9. Type "MAKE" - this will run MAKE.EXE, which will call TASM.EXE to
  126.    compile the assembly language source files that are needed to create
  127.    the SYSTEM UNIT.
  128.  
  129. 10. After MAKE has finished, there will be a file called "OS2.TPL".
  130.    Copy this into your BP-OS2 directory.
  131.  
  132. 11. Change to your BP-OS2 directory, and compile the following source
  133.     files for OS/2 compatibility;
  134.  
  135.           a.  COMPATIB.PAS
  136.           b.  DOS.PAS
  137.           c.  CRT.PAS
  138.  
  139.     i.e., you will type
  140.  
  141.           BPCOS2 -CO COMPATIB
  142.           BPCOS2 -CO DOS
  143.           BPCOS2 -CO CRT
  144.  
  145.     This will produce the unit files;
  146.  
  147.           COMPATIB.TPO
  148.           DOS.TPO and
  149.           CRT.TPO.
  150.  
  151.  With the new SYSTEM.TPO, you now have all you need to compile 16-bit OS/2
  152.  programs.
  153.  
  154.  That's all, folks!
  155.  
  156. You can compile the example programs to see the results of your efforts.
  157.  
  158.     The patches (BPOS2.EXE and BPCOS2.EXE) can actually be copied
  159.     into your BP7 directory. They will read the same .CFG, .TP, and
  160.     .DLL files as the unpatched versions. There will be no clash here,
  161.     because the units they produce and use have an extension .TPO
  162.     However, if you have installed your sources for BP7, you have
  163.     to be careful not to overwrite them with the OS/2 versions of
  164.     SYSTEM.PAS, DOS.PAS and CRT.PAS. Thus it may be better to keep
  165.     the patched EXEs in a separate directory.
  166.  
  167.     The only things being duplicated in the whole system are the two
  168.     patched executables and their source code. All the other binaries
  169.     are shared with the unpatched versions.
  170.  
  171. THE EXAMPLE PROGRAMS
  172. --------------------
  173.  
  174. 1. HELLO2.PAS - this is a text-mode "hello" program. All you need is
  175.    to compile this, and run it. If you run it from a DOS prompt, you
  176.    will get the message "This program requires OS/2" - it is a sign
  177.    that you are well and truly home.
  178.  
  179. 2. HELLOPM.PAS - this is a Presentation Manager "hello" program -
  180.    complete with menus, dialog boxes, etc.
  181.  
  182.   In order to compile and run the HELLOPM program and any other PM
  183.   program, you need to take the following steps;
  184.  
  185.       a. Compile MAKEPM.PAS as either a DOS or OS/2 program
  186.  
  187.       b. Compile your PM program
  188.  
  189.       c. Run MAKEPM on your PM program
  190.            e.g. "MAKEPM PMPROG.EXE"
  191.  
  192.       d. Run the OS/2 RC.EXE on your PM program and its resource file.
  193.          RC.EXE comes with the OS/2 operating system.
  194.  
  195.            e.g. "RC HELLOPM.RC HELLOPM.EXE"
  196.  
  197.         NOTE: You may have to run RC from an OS/2 command prompt.
  198.               Running it from a DOS prompt produces an error message.
  199.  
  200.       e. Run your OS/2 PM program!
  201.  
  202.  
  203. DISCLAIMER
  204. ----------
  205. I AM ONLY SUPPLYING THIS PATCH BECAUSE MANY PEOPLE HAVE ASKED FOR IT.
  206. I NEITHER WROTE IT, NOR AM I RESPONSIBLE FOR ITS USE. YOU USE THIS
  207. PATCH ENTIRELY AT YOUR OWN RISK. I WILL ACCEPT NO RESPONSIBILITY
  208. FOR ANY LOSS OR DAMAGE, WHETHER FINANCIAL, PHYSICAL, MENTAL,
  209. EMOTIONAL, MARITAL, SOCIAL, PROFESSIONAL, OR OTHERWISE, THAT MAY ARISE FROM
  210. THE USE OR THE PURPORTED USE OF THIS PATCH FOR ANY PURPOSE WHATSOEVER.
  211.  
  212. SO LET IT BE WRITTEN, SO LET IT BE DONE.
  213.  
  214. -------------------------------------
  215. Dr. A. Olowofoyeku
  216. Keele University
  217. England.
  218.  
  219. E-mail: laa12@seq1.keele.ac.uk
  220.  
  221. --------------------------------------
  222.  
  223.  
  224.